package com.niren.relay;

import com.niren.relay.netty.StartNetty;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;

@SpringBootApplication
@EnableCaching
public class RelayApplication {

    public static void main(String[] args) {
        startTcpServer();
        SpringApplication.run(RelayApplication.class, args);
    }

    public  static void startTcpServer(){
        Runnable startNetty = new StartNetty();

        Thread timeoutThread = new Thread(startNetty);
        timeoutThread.setDaemon(true);
        timeoutThread.setName("startNetty");
        timeoutThread.start();
    }

}
